import {createRouter, createWebHistory} from 'vue-router'

// 路由列表
const routes = [
  {
    meta:{
        title: "浮光在线教育-首页",
        keepAlive: true
    },
    path: '/',         // uri访问地址
    name: "Home",
    component: ()=> import("../views/Home.vue")
  },
  {
    meta:{
        title: "浮光-用户登录",
        keepAlive: true
    },
    path:'/login',      // uri访问地址
    name: "Login",
    component: ()=> import("../views/Login.vue")
  }
  ,{
      meta:{
        title: "浮光-用户注册",
        keepAlive: true
      },
      path: '/register',
      name: "Register",            // 路由名称
      component: ()=> import("../views/Register.vue"),         // uri绑定的组件页面
    },{
      meta:{
        title: "浮光-项目课",
        keepAlive: true
      },
      path: '/project',
      name: "Course",            // 路由名称
      component: ()=> import("../views/Course.vue"),         // uri绑定的组件页面
    },{
      meta:{
        title: "项目课",
        keepAlive: true
      },
      path: '/project/:id',     // :id vue的路径参数，代表了课程的ID
      name: "Info",
      component: ()=> import("../views/Info.vue"),
    }

]

// 路由对象实例化
const router = createRouter({
  // history, 指定路由的模式
  history: createWebHistory(),
  // 路由列表
  routes,
});


// 暴露路由对象
export default router